	format	MS COFF
	extrn	___bb_appstub_appstub
	extrn	___bb_audio_audio
	extrn	___bb_blitz_blitz
	extrn	___bb_cal3d_cal3d
	extrn	___bb_calb3d_calb3d
	extrn	___bb_d3d7max2d_d3d7max2d
	extrn	___bb_d3d9max2d_d3d9max2d
	extrn	___bb_data_data
	extrn	___bb_directsoundaudio_directsoundaudio
	extrn	___bb_eventqueue_eventqueue
	extrn	___bb_freeaudioaudio_freeaudioaudio
	extrn	___bb_freejoy_freejoy
	extrn	___bb_freeprocess_freeprocess
	extrn	___bb_freetypefont_freetypefont
	extrn	___bb_gnet_gnet
	extrn	___bb_loader_loader
	extrn	___bb_macos_macos
	extrn	___bb_map_map
	extrn	___bb_maxlua_maxlua
	extrn	___bb_maxutil_maxutil
	extrn	___bb_minib3d_minib3d
	extrn	___bb_oggloader_oggloader
	extrn	___bb_openalaudio_openalaudio
	extrn	___bb_tgaloader_tgaloader
	extrn	___bb_timer_timer
	extrn	___bb_wavloader_wavloader
	extrn	_bbEnd
	extrn	_bbMilliSecs
	extrn	_bbNullObject
	extrn	_bbObjectNew
	extrn	_bbOnDebugEnterScope
	extrn	_bbOnDebugEnterStm
	extrn	_bbOnDebugLeaveScope
	extrn	_bbStringClass
	extrn	_bbStringConcat
	extrn	_bbStringFromInt
	extrn	_brl_bank_LoadBank
	extrn	_brl_blitz_DebugStop
	extrn	_brl_blitz_NullObjectError
	extrn	_brl_graphics_Flip
	extrn	_brl_polledinput_KeyDown
	extrn	_brl_polledinput_KeyHit
	extrn	_c3d_cal3d_DeltaTimer
	extrn	_c3d_calb3d_CB3DModel
	extrn	_c3d_loader_LoadXMLAnimation
	extrn	_c3d_loader_LoadXMLMesh
	extrn	_c3d_loader_LoadXMLSkeleton
	extrn	_sidesign_minib3d_CreateCamera
	extrn	_sidesign_minib3d_CreateLight
	extrn	_sidesign_minib3d_Graphics3D
	extrn	_sidesign_minib3d_MoveEntity
	extrn	_sidesign_minib3d_PositionEntity
	extrn	_sidesign_minib3d_RenderWorld
	extrn	_sidesign_minib3d_Text
	extrn	_sidesign_minib3d_TurnEntity
	public	__bb_main
	section	"code" code
__bb_main:
	push	ebp
	mov	ebp,esp
	sub	esp,52
	push	ebx
	push	esi
	cmp	dword [_134],0
	je	_135
	mov	eax,0
	pop	esi
	pop	ebx
	mov	esp,ebp
	pop	ebp
	ret
_135:
	mov	dword [_134],1
	mov	dword [ebp-4],0
	mov	dword [ebp-8],0
	mov	dword [ebp-12],0
	mov	dword [ebp-16],0
	mov	dword [ebp-20],_bbNullObject
	mov	dword [ebp-24],_bbNullObject
	mov	dword [ebp-28],_bbNullObject
	mov	dword [ebp-32],_bbNullObject
	fldz
	fstp	dword [ebp-36]
	mov	dword [ebp-40],0
	mov	dword [ebp-44],0
	mov	dword [ebp-48],0
	mov	eax,ebp
	push	eax
	push	_114
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	call	___bb_blitz_blitz
	call	___bb_minib3d_minib3d
	call	___bb_cal3d_cal3d
	call	___bb_calb3d_calb3d
	call	___bb_loader_loader
	call	___bb_appstub_appstub
	call	___bb_audio_audio
	call	___bb_d3d7max2d_d3d7max2d
	call	___bb_d3d9max2d_d3d9max2d
	call	___bb_data_data
	call	___bb_directsoundaudio_directsoundaudio
	call	___bb_eventqueue_eventqueue
	call	___bb_freeaudioaudio_freeaudioaudio
	call	___bb_freetypefont_freetypefont
	call	___bb_gnet_gnet
	call	___bb_map_map
	call	___bb_maxlua_maxlua
	call	___bb_maxutil_maxutil
	call	___bb_oggloader_oggloader
	call	___bb_openalaudio_openalaudio
	call	___bb_tgaloader_tgaloader
	call	___bb_timer_timer
	call	___bb_wavloader_wavloader
	call	___bb_freejoy_freejoy
	call	___bb_freeprocess_freeprocess
	call	___bb_macos_macos
	push	_36
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	dword [ebp-4],1024
	mov	dword [ebp-8],768
	mov	dword [ebp-12],0
	mov	dword [ebp-16],2
	push	_42
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	-1
	push	60
	push	dword [ebp-16]
	push	dword [ebp-12]
	push	dword [ebp-8]
	push	dword [ebp-4]
	call	_sidesign_minib3d_Graphics3D
	add	esp,24
	push	_43
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	_bbNullObject
	call	_sidesign_minib3d_CreateCamera
	add	esp,4
	mov	dword [ebp-20],eax
	push	_45
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	0
	push	-1049624576
	push	1092616192
	push	0
	push	dword [ebp-20]
	call	_sidesign_minib3d_PositionEntity
	add	esp,20
	push	_46
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	_bbNullObject
	push	1
	call	_sidesign_minib3d_CreateLight
	add	esp,8
	mov	dword [ebp-24],eax
	push	_48
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	_c3d_calb3d_CB3DModel
	call	_bbObjectNew
	add	esp,4
	mov	dword [ebp-28],eax
	push	_50
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_52
	call	_brl_blitz_NullObjectError
_52:
	push	_25
	call	_brl_bank_LoadBank
	add	esp,4
	push	eax
	call	_c3d_loader_LoadXMLSkeleton
	add	esp,4
	push	eax
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+48]
	add	esp,8
	push	_53
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_55
	call	_brl_blitz_NullObjectError
_55:
	push	_26
	call	_brl_bank_LoadBank
	add	esp,4
	push	eax
	call	_c3d_loader_LoadXMLMesh
	add	esp,4
	push	eax
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+60]
	add	esp,8
	push	_56
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_58
	call	_brl_blitz_NullObjectError
_58:
	push	_27
	call	_brl_bank_LoadBank
	add	esp,4
	push	eax
	call	_c3d_loader_LoadXMLMesh
	add	esp,4
	push	eax
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+60]
	add	esp,8
	push	_59
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_61
	call	_brl_blitz_NullObjectError
_61:
	push	_bbNullObject
	push	_28
	call	_brl_bank_LoadBank
	add	esp,4
	push	eax
	call	_c3d_loader_LoadXMLAnimation
	add	esp,8
	push	eax
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+56]
	add	esp,8
	push	_62
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_64
	call	_brl_blitz_NullObjectError
_64:
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+64]
	add	esp,4
	push	_65
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-28]
	cmp	ebx,_bbNullObject
	jne	_67
	call	_brl_blitz_NullObjectError
_67:
	push	1
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+52]
	add	esp,8
	push	_68
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	1106247680
	call	dword [_c3d_cal3d_DeltaTimer+48]
	add	esp,4
	mov	dword [ebp-32],eax
	push	_70
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	fldz
	fstp	dword [ebp-36]
	push	_72
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_bbMilliSecs
	mov	dword [ebp-40],eax
	push	_74
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	dword [ebp-44],0
	push	_76
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	dword [ebp-48],0
	push	_78
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	jmp	_29
_31:
	mov	eax,ebp
	push	eax
	push	_112
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	push	_79
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	ebx,dword [ebp-32]
	cmp	ebx,_bbNullObject
	jne	_81
	call	_brl_blitz_NullObjectError
_81:
	push	ebx
	mov	eax,dword [ebx]
	call	dword [eax+52]
	add	esp,4
	push	_82
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	13
	call	_brl_polledinput_KeyHit
	add	esp,4
	cmp	eax,0
	je	_83
	mov	eax,ebp
	push	eax
	push	_85
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	push	_84
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_brl_blitz_DebugStop
	call	dword [_bbOnDebugLeaveScope]
_83:
	push	_86
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	87
	call	_brl_polledinput_KeyDown
	add	esp,4
	mov	ebx,eax
	push	83
	call	_brl_polledinput_KeyDown
	add	esp,4
	sub	ebx,eax
	mov	dword [ebp+-52],ebx
	fild	dword [ebp+-52]
	sub	esp,4
	fstp	dword [esp]
	push	0
	push	68
	call	_brl_polledinput_KeyDown
	add	esp,4
	mov	ebx,eax
	push	65
	call	_brl_polledinput_KeyDown
	add	esp,4
	sub	ebx,eax
	mov	dword [ebp+-52],ebx
	fild	dword [ebp+-52]
	sub	esp,4
	fstp	dword [esp]
	push	dword [ebp-20]
	call	_sidesign_minib3d_MoveEntity
	add	esp,16
	push	_87
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	0
	push	0
	push	37
	call	_brl_polledinput_KeyDown
	add	esp,4
	mov	ebx,eax
	push	39
	call	_brl_polledinput_KeyDown
	add	esp,4
	sub	ebx,eax
	mov	dword [ebp+-52],ebx
	fild	dword [ebp+-52]
	sub	esp,4
	fstp	dword [esp]
	push	40
	call	_brl_polledinput_KeyDown
	add	esp,4
	mov	ebx,eax
	push	38
	call	_brl_polledinput_KeyDown
	add	esp,4
	sub	ebx,eax
	mov	dword [ebp+-52],ebx
	fild	dword [ebp+-52]
	sub	esp,4
	fstp	dword [esp]
	push	dword [ebp-20]
	call	_sidesign_minib3d_TurnEntity
	add	esp,20
	push	_88
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	189
	call	_brl_polledinput_KeyDown
	add	esp,4
	cmp	eax,0
	je	_89
	mov	eax,ebp
	push	eax
	push	_91
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	push	_90
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	fld	dword [ebp-36]
	fsub	dword [_136]
	fstp	dword [ebp-36]
	call	dword [_bbOnDebugLeaveScope]
_89:
	push	_92
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	187
	call	_brl_polledinput_KeyDown
	add	esp,4
	cmp	eax,0
	je	_93
	mov	eax,ebp
	push	eax
	push	_95
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	push	_94
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	fld	dword [ebp-36]
	fadd	dword [_137]
	fstp	dword [ebp-36]
	call	dword [_bbOnDebugLeaveScope]
_93:
	push	_96
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	esi,dword [ebp-28]
	cmp	esi,_bbNullObject
	jne	_98
	call	_brl_blitz_NullObjectError
_98:
	mov	ebx,dword [ebp-32]
	cmp	ebx,_bbNullObject
	jne	_100
	call	_brl_blitz_NullObjectError
_100:
	fld	dword [ebx+24]
	fdiv	dword [_138]
	sub	esp,4
	fstp	dword [esp]
	push	esi
	mov	eax,dword [esi]
	call	dword [eax+68]
	add	esp,8
	push	_101
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_sidesign_minib3d_RenderWorld
	push	_102
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	add	dword [ebp-44],1
	push	_103
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_bbMilliSecs
	sub	eax,dword [ebp-40]
	cmp	eax,1000
	jl	_104
	mov	eax,ebp
	push	eax
	push	_108
	call	dword [_bbOnDebugEnterScope]
	add	esp,8
	push	_105
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_bbMilliSecs
	mov	dword [ebp-40],eax
	push	_106
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	eax,dword [ebp-44]
	mov	dword [ebp-48],eax
	push	_107
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	mov	dword [ebp-44],0
	call	dword [_bbOnDebugLeaveScope]
_104:
	push	_109
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	dword [ebp-48]
	call	_bbStringFromInt
	add	esp,4
	push	eax
	push	_32
	call	_bbStringConcat
	add	esp,8
	push	eax
	push	0
	push	0
	call	_sidesign_minib3d_Text
	add	esp,12
	push	_110
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	_33
	push	20
	push	0
	call	_sidesign_minib3d_Text
	add	esp,12
	push	_111
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	push	-1
	call	_brl_graphics_Flip
	add	esp,4
	call	dword [_bbOnDebugLeaveScope]
_29:
	push	27
	call	_brl_polledinput_KeyDown
	add	esp,4
	cmp	eax,0
	je	_31
_30:
	push	_113
	call	dword [_bbOnDebugEnterStm]
	add	esp,4
	call	_bbEnd
	mov	ebx,0
	jmp	_34
_34:
	call	dword [_bbOnDebugLeaveScope]
	mov	eax,ebx
	pop	esi
	pop	ebx
	mov	esp,ebp
	pop	ebp
	ret
	section	"data" data writeable align 8
	align	4
_134:
	dd	0
_115:
	db	"demo1",0
_116:
	db	"width",0
_117:
	db	"i",0
_118:
	db	"height",0
_119:
	db	"depth",0
_120:
	db	"mode",0
_121:
	db	"cam",0
_122:
	db	":TCamera",0
_123:
	db	"light",0
_124:
	db	":TLight",0
_125:
	db	"calmodel",0
_126:
	db	":CB3DModel",0
_127:
	db	"dt",0
_128:
	db	":DeltaTimer",0
_129:
	db	"anim_time",0
_130:
	db	"f",0
_131:
	db	"old_ms",0
_132:
	db	"renders",0
_133:
	db	"fps",0
	align	4
_114:
	dd	1
	dd	_115
	dd	2
	dd	_116
	dd	_117
	dd	-4
	dd	2
	dd	_118
	dd	_117
	dd	-8
	dd	2
	dd	_119
	dd	_117
	dd	-12
	dd	2
	dd	_120
	dd	_117
	dd	-16
	dd	2
	dd	_121
	dd	_122
	dd	-20
	dd	2
	dd	_123
	dd	_124
	dd	-24
	dd	2
	dd	_125
	dd	_126
	dd	-28
	dd	2
	dd	_127
	dd	_128
	dd	-32
	dd	2
	dd	_129
	dd	_130
	dd	-36
	dd	2
	dd	_131
	dd	_117
	dd	-40
	dd	2
	dd	_132
	dd	_117
	dd	-44
	dd	2
	dd	_133
	dd	_117
	dd	-48
	dd	0
_37:
	db	"$BMXPATH/projects/DemoCal3d/demo1.bmx",0
	align	4
_36:
	dd	_37
	dd	8
	dd	1
	align	4
_42:
	dd	_37
	dd	10
	dd	1
	align	4
_43:
	dd	_37
	dd	12
	dd	1
	align	4
_45:
	dd	_37
	dd	13
	dd	1
	align	4
_46:
	dd	_37
	dd	15
	dd	1
	align	4
_48:
	dd	_37
	dd	17
	dd	1
	align	4
_50:
	dd	_37
	dd	19
	dd	1
	align	4
_25:
	dd	_bbStringClass
	dd	2147483647
	dd	8
	dw	116,101,115,116,46,120,115,102
	align	4
_53:
	dd	_37
	dd	20
	dd	1
	align	4
_26:
	dd	_bbStringClass
	dd	2147483647
	dd	9
	dw	116,101,115,116,112,46,120,109,102
	align	4
_56:
	dd	_37
	dd	21
	dd	1
	align	4
_27:
	dd	_bbStringClass
	dd	2147483647
	dd	17
	dw	112,97,108,97,100,105,110,95,99,97,112,101,49,46,120,109
	dw	102
	align	4
_59:
	dd	_37
	dd	22
	dd	1
	align	4
_28:
	dd	_bbStringClass
	dd	2147483647
	dd	7
	dw	114,117,110,46,120,97,102
	align	4
_62:
	dd	_37
	dd	23
	dd	1
	align	4
_65:
	dd	_37
	dd	24
	dd	1
	align	4
_68:
	dd	_37
	dd	26
	dd	1
	align	4
_70:
	dd	_37
	dd	28
	dd	1
	align	4
_72:
	dd	_37
	dd	31
	dd	1
	align	4
_74:
	dd	_37
	dd	32
	dd	1
	align	4
_76:
	dd	_37
	dd	33
	dd	1
	align	4
_78:
	dd	_37
	dd	35
	dd	1
	align	4
_112:
	dd	3
	dd	0
	dd	0
	align	4
_79:
	dd	_37
	dd	36
	dd	2
	align	4
_82:
	dd	_37
	dd	37
	dd	2
	align	4
_85:
	dd	3
	dd	0
	dd	0
	align	4
_84:
	dd	_37
	dd	37
	dd	28
	align	4
_86:
	dd	_37
	dd	40
	dd	2
	align	4
_87:
	dd	_37
	dd	41
	dd	2
	align	4
_88:
	dd	_37
	dd	43
	dd	2
	align	4
_91:
	dd	3
	dd	0
	dd	0
	align	4
_90:
	dd	_37
	dd	43
	dd	29
	align	4
_136:
	dd	0x3dcccccd
	align	4
_92:
	dd	_37
	dd	44
	dd	2
	align	4
_95:
	dd	3
	dd	0
	dd	0
	align	4
_94:
	dd	_37
	dd	44
	dd	30
	align	4
_137:
	dd	0x3dcccccd
	align	4
_96:
	dd	_37
	dd	47
	dd	2
	align	4
_138:
	dd	0x41f00000
	align	4
_101:
	dd	_37
	dd	48
	dd	2
	align	4
_102:
	dd	_37
	dd	49
	dd	2
	align	4
_103:
	dd	_37
	dd	52
	dd	2
	align	4
_108:
	dd	3
	dd	0
	dd	0
	align	4
_105:
	dd	_37
	dd	53
	dd	3
	align	4
_106:
	dd	_37
	dd	54
	dd	3
	align	4
_107:
	dd	_37
	dd	55
	dd	3
	align	4
_109:
	dd	_37
	dd	58
	dd	2
	align	4
_32:
	dd	_bbStringClass
	dd	2147483647
	dd	5
	dw	70,80,83,58,32
	align	4
_110:
	dd	_37
	dd	59
	dd	2
	align	4
_33:
	dd	_bbStringClass
	dd	2147483647
	dd	14
	dw	43,47,45,32,116,111,32,97,110,105,109,97,116,101
	align	4
_111:
	dd	_37
	dd	62
	dd	2
	align	4
_113:
	dd	_37
	dd	65
	dd	1
